package com.breaktian.assemble.utils;

import android.os.Environment;

import java.io.File;


/**
 * Created by zerup on 17/4/15.
 */

public class PathUtil {
    public static final String DIR_ANDROID = "Android";
    private static final String DIR_CACHE = "za-cache";
    private static final String DIR_DATA = "data";

    public static boolean isUrl(String path) {
        if (path == null) {
            return false;
        }
        if (path.startsWith("http://") || path.startsWith("https://")) {
            return true;
        }
        return false;
    }

    public static boolean isLocalPath(String path) {
        if (path == null) {
            return false;
        }
        return !isUrl(path);
    }

    /**
     * 获取外部存储路径
     * */
    public static File getExternalStorageDirectory() {
        return Environment.getExternalStorageDirectory();
    }



    /**
     * 获取下载目录
     */
    public static String getDownloadDir() {
        return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).toString();
    }
}
